home *** CD-ROM | disk | FTP | other *** search
- /*
-
- Compile this program under large model, with the
- default compiler options and link it with these libs.
- (Use the libs that correspond to your compiler.) :
-
- WindowPro large model library,
- DialogPro large model library, and
- HypeIt! large model library
-
- */
-
- #include "pro.h"
- #include "xglobals.h"
- #include "dbpro.h"
- #include "hypeit.h"
- #include "colors.h"
- #include <stdlib.h>
- #include <conio.h>
-
- /*
- stack requirements are generally dependent on the maximum number
- of connectors allowed in each node. (defined by MAXDEFS.)
-
- In this case we used a MAXDEFS of 35. When we invoked hypeit
- from within hypeit we ran out of stack space -- so we had to
- increase it somewhat. If you are using MS C you will need to
- increase stack size at link time.
- */
- #ifdef __TURBOC__
- unsigned _stklen = 5000;
- #endif
-
- main(argv, argc)
- int argv;
- char *argc[];
- {
- char *t, *i, t1[20], i1[20];
- int quit = 0;
-
- if (argv == 1) {
- t = "hypeit.txt";
- i = "hypeit.idx";
- }
- else {
- sprintf(t1,"%s.txt",argc[1]);
- sprintf(i1,"%s.idx",argc[1]);
- t = t1;
- i = i1;
- }
-
- /* change the default colors to something more pleasing */
- default_db_colors.response_bg = black;
- default_db_colors.response_fg = white;
- default_db_colors.question_bg = black;
- default_db_colors.question_fg = white;
- default_db_colors.key_bg = black;
- default_db_colors.key_fg = red;
- default_db_colors.select_bg = lightgray;
- default_db_colors.select_fg = black;
-
- /* initializes the windowing, dialog box and help systems */
- init_help(t, i);
-
- /* If you are using DialogPro you would go on and establish */
- /* your dialog boxes and windows and register each dialog box */
- /* with the help system, whenever the user pressed F1 it would */
- /* enter HypeIt! by calling dispnode with the appropriate text */
- /* id given the context that the F1 key was in when it was */
- /* pressed. In this case, since we don't really have a real */
- /* application we bypass the built in help system and go */
- /* directly to our main text node. */
- while (!quit) {
- dispnode(TOPICSNODE);
- printf("Exit? (Y)es or (N)o ");
- switch(getch()) {
- case 'Y':
- case 'y':
- exit(0);
- break;
- }
- }
- }